From: Hellyna Ng Date: Thu, 30 Dec 2010 21:09:56 +0000 (+0800) Subject: Group chat sources on the left in the message tray X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9145 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6c55ca59b03b6e48a69f16e9779417eee2d161d7;p=gnome-shell.git Group chat sources on the left in the message tray This will make it easier for users to get back to their chats. https://bugzilla.gnome.org/show_bug.cgi?id=617234 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 1812983d9..aa1bdd13f 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -806,6 +806,7 @@ Source.prototype = { this._iconBin = new St.Bin({ width: this.ICON_SIZE, height: this.ICON_SIZE }); this.isTransient = false; + this.isChat = false; }, setTransient: function(isTransient) { @@ -1025,6 +1026,7 @@ MessageTray.prototype = { // added to the summary without a notification being shown. this._newSummaryItems = []; this._longestSummaryItem = null; + this._chatSummaryItemsCount = 0; }, _setSizePosition: function() { @@ -1058,7 +1060,12 @@ MessageTray.prototype = { let summaryItem = new SummaryItem(source); - this._summary.insert_actor(summaryItem.actor, 0); + if (source.isChat) { + this._summary.insert_actor(summaryItem.actor, 0); + this._chatSummaryItemsCount++; + } else { + this._summary.insert_actor(summaryItem.actor, this._chatSummaryItemsCount); + } let titleWidth = summaryItem.getTitleNaturalWidth(); if (titleWidth > this._summaryItemTitleWidth) { @@ -1123,6 +1130,10 @@ MessageTray.prototype = { this._newSummaryItems.splice(newSummaryItemsIndex, 1); this._summaryItems.splice(index, 1); + + if (source.isChat) + this._chatSummaryItemsCount--; + if (this._longestSummaryItem.source == source) { let newTitleWidth = 0; this._longestSummaryItem = null; diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js index ed8feae7d..8dcbfed5a 100644 --- a/js/ui/telepathyClient.js +++ b/js/ui/telepathyClient.js @@ -455,6 +455,8 @@ Source.prototype = { _init: function(accountPath, connPath, channelPath, targetHandle, targetHandleType, targetId) { MessageTray.Source.prototype._init.call(this, targetId); + this.isChat = true; + this._accountPath = accountPath; let connName = Telepathy.pathToName(connPath);